package com.example.shopping2.a_c_fragment.home.adapter

import android.widget.ImageView
import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.shopping2.R
import com.example.shopping2.a_c_fragment.home.entity.HomeGoodsEntity

class HomeAdaoter(list: ArrayList<HomeGoodsEntity.DataBean>) :
    BaseQuickAdapter<HomeGoodsEntity.DataBean, BaseViewHolder>(R.layout.home_item, list) {
    override fun convert(holder: BaseViewHolder, item: HomeGoodsEntity.DataBean) {

        holder.setText(R.id.mGoodsDetailItemTitleTv, item.goods_desc)
        holder.setText(R.id.mGoodsDetailItemPriceTv, "￥:" + item.goods_default_price)
        var view = holder.getView<ImageView>(R.id.mGoodsDetailItemIv)
        Glide.with(context).load(item.goods_default_icon).into(view)
    }

}